package cn.amossun.starter.web.data.security;

import cn.amossun.starter.common.util.Page;
import cn.amossun.starter.web.data.security.entity.DataSecurityConfigBO;
import cn.amossun.starter.mybatis.data.security.properties.ResultMapConfiguration;
import cn.amossun.starter.redis.cache.exception.RedisCacheConfigException;
import cn.amossun.starter.redis.cache.exception.RedisCacheConfigNotFoundException;
import cn.amossun.starter.redis.cache.exception.RedisRelatedException;
import cn.amossun.starter.web.data.security.entity.DataSecurityConfigDTO;

import java.util.List;

/**
 * @description:
 * @author: Amos.Sun
 * @DateTime: 2020/03/08 17:37
 **/
public interface IDataSecurityConfig extends IServiceRedisConfig {

	List<ResultMapConfiguration> getAllConfigs(String serviceName) throws RedisRelatedException, RedisCacheConfigException;

	Page<DataSecurityConfigBO> getOriginConfigs(String serviceName, int current, int size, String tableName) throws RedisRelatedException, RedisCacheConfigException;

	boolean checkConfig(String serviceName, List<ResultMapConfiguration> resultMapConfigurations) throws RedisCacheConfigNotFoundException, RedisCacheConfigException;

	boolean save(DataSecurityConfigDTO param) throws RedisRelatedException, RedisCacheConfigException, RedisCacheConfigNotFoundException;

	boolean update(DataSecurityConfigDTO param) throws RedisRelatedException, RedisCacheConfigException, RedisCacheConfigNotFoundException;

	boolean remove(DataSecurityConfigDTO param) throws RedisRelatedException, RedisCacheConfigException;

	boolean rollback(String userId, String serviceName, String version) throws RedisCacheConfigException, RedisRelatedException;

	List<String> getDynamicRedis();
}
